import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/historySearch/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: Home,
    meta: {
      isNav: true
    },
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import('../views/historySearch/Search.vue'),
    meta: {
      isNav: false
    },
  },
  {
    path: '/',
    name: 'Index',
    component: () => import('../views/movie/Index.vue'),
    meta: {
      isNav: false
    },
  },
  {
    path: '/movie',
    name: 'Movie',
    component: () => import('../views/movie/Movie.vue'),
    meta: {
      isNav: true
    },
  },
  {
    path: '/detail/:id',
    name: 'Detail',
    component: () => import('../views/movie/Detail.vue'),
    meta: {
      isNav: false
    },
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
